# -*- coding: utf-8 -*-
# בש״ד
#
# Miraflores Blog for Django - Part of the Cuba Libre Project
# Copyright (C) 2009, Joshua "jag" Ginsberg <jag@flowtheory.net>
# 
# Por mi amor, que inspira a mi cada respiración y que echa de Cuba
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from django.conf.urls.defaults import *
from miraflores import feeds
from miraflores import search_indexes

feeds = {'rss': feeds.RSSFeed,
         'atom': feeds.AtomFeed}

urlpatterns = patterns(
    '',
    url(r'^$',
        'miraflores.views.blog_entry_list',
        name='miraflores_blog_entry_list'),
        
    url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{1,2})/(?P<day>[0-9]{1,2})/(?P<slug>[0-9a-zA-Z_-]+)/$',
        'miraflores.views.blog_entry_detail',
        name='miraflores_blog_entry_detail'),
        
    url(r'^(?P<year>[0-9]{4})/$',
        'miraflores.views.blog_entry_archive',
        name='miraflores_blog_entry_archive_by_year'),
        
    url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{1,2})/$',
        'miraflores.views.blog_entry_archive',
        name='miraflores_blog_entry_archive_by_month'),
        
    url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{1,2})/(?P<day>[0-9]{1,2})/$',
        'miraflores.views.blog_entry_archive',
        name='miraflores_blog_entry_archive_by_day'),
    
    url(r'^tag/(?P<tag>.*)/$',
        'miraflores.views.blog_entry_list_by_tag',
        name='miraflores_tagged_entry_list'),
    
    url(r'^category/(?P<category>.*)/$',
        'miraflores.views.blog_entry_list_by_category',
        name='miraflores_categorized_entry_list'),
    
    url(r'^feeds/(?P<url>.*)/$',
        'django.contrib.syndication.views.feed',
        {'feed_dict': feeds},
        name='miraflores_syndication'),
    
    url(r'^ajax/tagsearch/$',
        'miraflores.views.ajax_tagsearch',
        name='miraflores_ajax_tagsearch'),
    
    url(r'^search/$',
        'miraflores.views.blog_search',
        name='miraflores_search'),
    
    url(r'^admin/comments/(?P<comment_id>[0-9]+)/spam/$',
        'miraflores.views.admin_report_comment_spam',
        name='miraflores_admin_report_spam'),
    
    url(r'^admin/comments/(?P<comment_id>[0-9]+)/notspam/$',
        'miraflores.views.admin_report_comment_not_spam',
        name='miraflores_admin_report_not_spam'),

)

